﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/view.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Workflow.Resource" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        function upload() {

            //alert(user_form);
            $('#form').form('submit', {
                url: '/Holiday/UploadHoliday',
                success: function (data) {
                    eval('data=' + data);
                    $("#panelload").css("display", "none");
                    if (data.Success) {
                        // _user_form.form('clear');
                        $.messager.alert('<%=Global.InfoTitle%>', data.Message, 'info');
                    } else {
                        $.messager.alert('<%=Global.ErrorTitle%>', data.Message, 'error');
                    }
                },
                onSubmit: function () {
                    if ($("#FileUpload1").val() == "") {

                        $.messager.alert('<%=Global.InfoTitle%>', '<%=Global.InputUploadFile%>', 'info');
                        return false;
                    }
                    else {
                        $("#panelload").css("display", "inline");
                        //if (_user_form.valid())
                        return true;
                    }
                    // else
                    //    return false;
                }
            });



        }
        function toBack() {
            window.location = '/Holiday/HolidayView';
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="easyui-panel">
        <form id="form" method="post" action="/Holiday/UploadHoliday" enctype="multipart/form-data">
        <div class="panel-header">
            <%=Global.UploadHoliday%></div>
        <div class="panel-body">
            <%=Global.File%>:
            <input type="file" id="FileUpload1" name="FileUpload1" style="width: 500px">
            <a href="#" onclick="upload();" class="easyui-linkbutton" iconcls="icon-redo" plain="true">
                <%=Global.Import%></a> <a href="##" onclick="toBack()" class="easyui-linkbutton"
                    id="btn-cancel" icon="icon-undo">
                    <%=Global.back%></a>
            <div id="panelload" name="panelload" style="display: none">
                <image src="../../Image/Ajax/loading.gif"></image>
            </div>
        </div>
        </form>
    </div>
</asp:Content>
